A method is described for determining the topology of a serial asynchronous databus, to which at least a first bus subscriber and a second bus subscriber are connected, which subscribers communicate via a prescribed bus access protocol.
The method can basically be used on all serial databuses, in particular on fieldbus systems such as PROFIBUS, Fieldbus Foundation, but also on Ethernet and other fieldbus systems of known art and yet to be developed. A fieldbus connects field units in a system such as sensors and actuators, also designated as slaves, for purposes of communication and control with a control unit, also designated as the master. Since a plurality of subscribers transmit messages over the same line, a standardised bus access protocol is defined for each fieldbus system.
As a rule a fieldbus system comprises at least one master field unit (master) for purposes of controlling the system, and also a plurality of slave field units (slaves). Each bus subscriber is addressed by means of a uniquely associated address. The communication in a fieldbus system takes place via bus-specific telegrams or data packets or data frames, whereby the master as a rule controls the communication and transmits request telegrams, to which the slaves respond with response telegrams.
As a rule fieldbus systems have a complex network topology with a large number of bus segments and bus subscribers. For example, a PROFIBUS DP-network can have up to 127 subscribers, whereby up to 32 bus subscribers can be connected to individual bus segments of a bus line. Within the network the individual bus segments are connected by means of line drivers, so-called repeaters. In order to be able to undertake diagnostics and fault analysis in such a bus system, it is necessary for the network topology of the bus system, i.e. the arrangement of the bus segments, and of the subscribers on the individual bus segments, to be known. When troubleshooting, for example, the connected units, when observing signal quality, should be observed as far as possible in the order of their distance from the measurement unit, in order that the correct fault location can be determined. Also the topology of the fieldbus should be known when planning physical measurements, because measurements are best executed from the ends and the centre of the individual bus segments. If the order and length of the bus segments and the connection points of the units to the segments are not known, measurements cannot be planned efficiently.
Since fieldbus systems often have structures that have “evolved” and are poorly documented, it is also often the case that insufficient knowledge is available concerning the bus topology. Since, however, the lines of the fieldbus systems are often laid in cable ducts that are inaccessible, it is as a rule also impossible to keep track directly of the lines of a bus system so as to measure them easily. Various measurement methods for determining the topology of fieldbuses have therefore been developed.
In the case where a cable of the bus line has a known resistance per unit length the bus topology can be registered on the basis of DC current measurements, in that one-by-one the individual bus subscribers are located, and the length of the line from the measurement point up to the bus subscriber is determined via the DC resistance of the line. This method only delivers inaccurate results, because unknown influence factors such as contact resistances between connectors and cables distort the measurement result.
A more precise measurement method is a reflection-based run time measurement, which determines the cable length as a function of the known propagation velocity of the measurement signals. These reflection measurement methods are active measurement methods, i.e. they transmit active signals onto the bus and register the reflected signals. This means that the measurement methods as far as possible are only executed on a bus that is inoperative, because the transmitted test signals would interfere with the ongoing operation of the fieldbus. There are in fact also methods that execute active measurements during regular bus operation, in that they utilise transmission intervals provided by the bus access protocol for the measurements; however, these methods always contain the risk that the transmitted signals are nevertheless interfering with the communications on the bus.
WO 02/28061 A1 (also published as US 2001/098514 A1) describes a method for determining the network topology of a bus system, in which an initiating measurement telegram is transmitted to each bus subscriber, to which a diagnostic repeater, which combines a plurality of bus segments, responds with a segment identification and the other bus subscribers respond with a response telegram, whereby the diagnostic repeater also transmits a measurement signal to the responding bus subscribers, which is reflected by the latter, and whereby, from the time interval between the transmission of the measurement signal and the arrival of the reflection signals, the distance of the responding bus subscriber from the diagnostic repeater is determined. This method basically utilises the run time of the measurement signal, which is impressed on the response telegram of the slave, for purposes of determining the distances of the individual bus subscribers. A transmitting slave acts as an impedance, at which the measurement signal is reflected. The diagnostic repeater therefore waits until it receives the response telegram from the slave. At this point in time the slave transmits again, since the signal run times are smaller than the transmission time of the telegram. A time window within the telegram, during which the level does not alter, is then used for the reflection method. The method is a pure reflection method and is well-suited to the lower baud rates. At higher baud rates the time window for the measurement is very small and the measurement is therefore unreliable.
DE 100 48 741 C1 and DE 10 2005 055 429 A1 likewise describe methods and devices for purposes of line diagnostics of a bus system in accordance with the principle of reflection measurement.
DE 10 2010 000 249 A1 of the applicant describes a method for checking the electrical properties of a cable of a fieldbus system, whereby this method is based on altering the wiring configuration of the fieldbus for the individual measurements. For this purpose a configurable switching device is provided, which can be connected with the bus.
The diagnostic methods for determining the bus topology in the prior art are thus based almost exclusively on reflection measurements. The method for measuring the electrical resistance of the line represents the single exception. Most reflection methods, and also the electrical method, assume an inoperative bus. These measurements can therefore not be executed during ongoing operation of the bus. The accuracy of the reflection measurement decreases with increasing data transfer baud rate.
Another type of diagnostic method for a fieldbus system is of known from DE 10 2006 051 444 A1. This method serves not so much the purpose of determining the bus topology as that of determining the states of the bus subscribers by the registration and analysis of the data packets exchanged on the bus, and by means of an in-line derivation of the states of the bus subscribers as a type of state machine.